# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.MyBusinessBusinessInformation.V1.Model.AttributeMetadata do
  @moduledoc """
  Metadata for an attribute. Contains display information for the attribute, including a localized name and a heading for grouping related attributes together.

  ## Attributes

  *   `deprecated` (*type:* `boolean()`, *default:* `nil`) - If true, the attribute is deprecated and should no longer be used. If deprecated, updating this attribute will not result in an error, but updates will not be saved. At some point after being deprecated, the attribute will be removed entirely and it will become an error.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - The localized display name for the attribute, if available; otherwise, the English display name.
  *   `groupDisplayName` (*type:* `String.t`, *default:* `nil`) - The localized display name of the group that contains this attribute, if available; otherwise, the English group name. Related attributes are collected into a group and should be displayed together under the heading given here.
  *   `parent` (*type:* `String.t`, *default:* `nil`) - The unique identifier for the attribute.
  *   `repeatable` (*type:* `boolean()`, *default:* `nil`) - If true, the attribute supports multiple values. If false, only a single value should be provided.
  *   `valueMetadata` (*type:* `list(GoogleApi.MyBusinessBusinessInformation.V1.Model.AttributeValueMetadata.t)`, *default:* `nil`) - For some types of attributes (for example, enums), a list of supported values and corresponding display names for those values is provided.
  *   `valueType` (*type:* `String.t`, *default:* `nil`) - The value type for the attribute. Values set and retrieved should be expected to be of this type.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :deprecated => boolean() | nil,
          :displayName => String.t() | nil,
          :groupDisplayName => String.t() | nil,
          :parent => String.t() | nil,
          :repeatable => boolean() | nil,
          :valueMetadata =>
            list(GoogleApi.MyBusinessBusinessInformation.V1.Model.AttributeValueMetadata.t())
            | nil,
          :valueType => String.t() | nil
        }

  field(:deprecated)
  field(:displayName)
  field(:groupDisplayName)
  field(:parent)
  field(:repeatable)

  field(:valueMetadata,
    as: GoogleApi.MyBusinessBusinessInformation.V1.Model.AttributeValueMetadata,
    type: :list
  )

  field(:valueType)
end

defimpl Poison.Decoder, for: GoogleApi.MyBusinessBusinessInformation.V1.Model.AttributeMetadata do
  def decode(value, options) do
    GoogleApi.MyBusinessBusinessInformation.V1.Model.AttributeMetadata.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.MyBusinessBusinessInformation.V1.Model.AttributeMetadata do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
